<template>
  <div>
    <div class="item-block address" v-if="detailData.address_id>0 && detailData.is_self_take!=1">
      <!-- 定制==云集==出货商订单15分钟内可以修改收货地址 -->
      <div class="edit-btn" @click="linkTo(detailAll.url)" v-if="detailData.is_can_operate_address==1">编辑收货地址</div>
      <div class="left"></div>
      <div class="right">
        <div class="name">{{detailData.name}} {{detailData.mobile}}</div>
        <div class="addr">{{detailData.address}}</div>
      </div>
      <div class="status-address" @click="showAddressAfter = true" v-if="detailData.client_edit_order_address && detailData.client_edit_order_address == 0">
        <template v-if="detailData.client_edit_order_address == 0">收货地址修改已提交，待商家审核</template>
      </div>
      <div class="status-address noBg" :class="detailData.client_edit_order_address && detailData.client_edit_order_address == 1 ? 'greenFont' :''" v-if="detailData.client_edit_order_address && (detailData.client_edit_order_address == 1 || detailData.client_edit_order_address == 2)">
        <template v-if="detailData.client_edit_order_address == 1">修改成功</template>
        <template v-else-if="detailData.client_edit_order_address == 2">修改失败</template>
      </div>
    </div>
    <!-- 确定修改地址 -->
    <van-dialog
      v-model="showAddressAfter"
      :showConfirmButton="false"
      show-cancel-button
      cancelButtonText="我知道了"
      class="common-confirm"
    >
    <div class="donation-box">
        <div class="con-box">
          <div class="title">修改后收货信息</div>
          <div class="input-box">
            <div class="tongMsg">{{detailData.edit_name}} {{detailData.edit_mobile}}</div>
            <div class="tongMsg">{{detailData.edit_province}}{{detailData.edit_city}}{{detailData.edit_town}}{{detailData.edit_address}}</div>
          </div>
        </div>
      </div>
    </van-dialog>
  </div>
</template>

<script>
import Vue from 'vue'

export default Vue.extend({
  props: {
    detailAll: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      showAddressAfter: false
    }
  },
  methods: {
  },
  computed: {
    detailData() {
      return this.detailAll.detail
    }
  }
})
</script>

<style lang="scss">
@import "src/styles/order/detail";
.address {
  flex-wrap: wrap;
}
.status-address {
  width: 100%;
  // padding: 10px 20px 0 50px;
  color: #f20b22;
  font-weight: 500;
  font-size: 24px;
  background: url("https://img.wifenxiao.com/h5-wfx/images/loop_left.png") right center no-repeat;
  background-size: 30px 30px;
  border-top: 1px solid #e5e5e5;
  margin: 20px 0px 0 50px;
  padding-top: 10px;
  background-position-y: 20px;
  &.noBg {
    background: transparent;
    border: none;
    padding-top: 0;
    margin-top: 0
  }
  &.greenFont {
    color: #6fc274
  }
}
.donation-box{
  .con-box{
    position:relative;
    padding:40px 60px;
  }
  .title {
    font-size: 35px;
    color: #333;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
  }
  .input-box{
    margin:16px 0;
    font-size:28px;
    .tongMsg {
      margin-top: 10px;
    }
  }
}
</style>